import store from "@/store";

export const itemStyle = {
  marginBottom: 0,
  padding: "10px 40px",
};

// 表单配置项
export const formBase = [
  {
    type: "daterange",
    field: "shelfTime",
    label: "打单日期",
    otherOptions: {
      type: "datetimerange",
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              console.log("start.getTime()", start.getTime());
              console.log("日期", this.riqi);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      valueFormat: "yyyy-MM-dd HH:mm:ss",
    },
  },
  {
    label: "时效",
    type: "select",
    field: "flightEffectiveness",
    optionsKey: "name",
    optionsValue: "name",
    options: store.state.custom_dict.timely,
  },
  {
    label: "打单员工",
    type: "input",
    field: "printName",
  },
];

// 表格配置项
export const tableBase = [
  {
    label: "员工",
    prop: "printName",
  },
  {
    label: "集包单数量",
    prop: "orderCount",
    width: 140,
  },
  {
    label: "集包单重量",
    prop: "orderWeight",
    width: 140,
  },
  {
    label: "快递单重量",
    prop: "expressDeliveryWeight",
    width: 200,
  },
  {
    label: "快递单数量",
    prop: "expressDeliveryCount",
    width: 140,
  },
];

// 表格配置项
export const tableBase2 = [
  {
    label: "员工",
    prop: "printName",
    width: 300,
  },
  {
    label: "订单号",
    prop: "orderNo",
    width: 140,
  },
  {
    label: "快递单号",
    prop: "courierNumber",
    width: 200,
  },
  {
    label: "集包单号",
    prop: "transferOrderNumber",
    width: 200,
  },
  {
    label: "打单时间",
    prop: "printTime",
    width: 140,
  },
  {
    label: "会员id",
    prop: "userId",
    width: 140,
  },
  {
    label: "服务方式",
    prop: "serviceMethod",
    width: 140,
  },
  {
    label: "付款方式",
    prop: "paymentMethod",
    width: 200,
  },
  {
    label: "转单号重量",
    prop: "transferOrderNumberWeight",
    width: 200,
  },
  {
    label: "取大重",
    prop: "bigWeight",
    width: 200,
  },
  {
    label: "重量",
    prop: "orderWeight",
    width: 200,
  },
  {
    label: "件数",
    prop: "pieces",
    width: 200,
  },
  {
    label: "时效渠道",
    prop: "flightEffectiveness",
    width: 200,
  },
  {
    label: "收货地址",
    prop: "address",
    width: 200,
  },
  {
    label: "会员昵称",
    prop: "userName",
    width: 200,
  },
];
